Purge
ThePurge
method releases any unneeded memory during low-memory situations.
ODSize Purge (in ODSize size);
size
- The number of bytes needed by OpenDoc, expressed as an unsigned 32-bit value.
- return value
- The number of bytes that were released by this object.
DISCUSSION
Your part may call this method, but in general, OpenDoc calls this method in low-memory situations to free any caches, noncritical buffers, or objects; you should not allocate memory for this operation.Because the
ODObject
class does not allocate (or deallocate) any memory, it always returns the value 0.OVERRIDING
Every subclass ofODObject
can override this method and should do so if it creates caches and temporary buffers. Your subclass ofODPart
must override this method or risk running out of available memory. Your override method must call its inheritedPurge
method at some point in your implementation (it does not matter where). You should save the size value returned by the inheritedPurge
method, and then add it to the size value returned by your override method to determine the amount of memory actually released.SEE ALSO
TheODPart
class (page 459).
"The Purge Method" on page 115 in OpenDoc Cookbook.
Table 2-1 on page 89 in OpenDoc Programmer's Guide.
"Reference-Counted Objects" on page 468 in OpenDoc Programmer's Guide.
"Purging" on page 472 in OpenDoc Programmer's Guide.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help